<?php

/**
 * GetSellingPartnerMetricsResponseMetric.
 *
 * PHP version 8.3
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * Selling Partner API for Replenishment.
 *
 * The Selling Partner API for Replenishment (Replenishment API) provides programmatic access to replenishment program metrics and offers. These programs provide recurring delivery of any replenishable item at a frequency chosen by the customer.  The Replenishment API is available worldwide wherever Amazon Subscribe & Save is available or is supported. The API is available to vendors and FBA selling partners.
 *
 * The version of the OpenAPI document: 2022-11-07
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.9.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace SpApi\Model\replenishment\v2022_11_07;

use SpApi\Model\ModelInterface;
use SpApi\ObjectSerializer;

/**
 * GetSellingPartnerMetricsResponseMetric Class Doc Comment.
 *
 * @category Class
 *
 * @description An object which contains metric data for a selling partner.
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 *
 * @implements \ArrayAccess<string, mixed>
 */
class GetSellingPartnerMetricsResponseMetric implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
     * The original name of the model.
     */
    protected static string $openAPIModelName = 'GetSellingPartnerMetricsResponseMetric';

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static array $openAPITypes = [
        'not_delivered_due_to_oos' => 'float',
        'total_subscriptions_revenue' => 'float',
        'shipped_subscription_units' => 'float',
        'active_subscriptions' => 'float',
        'subscriber_average_revenue' => 'float',
        'non_subscriber_average_revenue' => 'float',
        'lost_revenue_due_to_oos' => 'float',
        'subscriber_average_reorders' => 'float',
        'non_subscriber_average_reorders' => 'float',
        'coupons_revenue_penetration' => 'float',
        'revenue_from_subscriptions_with_multiple_deliveries' => 'float',
        'revenue_from_active_subscriptions_with_single_delivery' => 'float',
        'revenue_from_cancelled_subscriptions_after_single_delivery' => 'float',
        'subscriber_retention_for30_days' => 'float',
        'subscriber_retention_for90_days' => 'float',
        'revenue_penetration_for0_percent_seller_funding' => 'float',
        'revenue_penetration_for5_percent_seller_funding' => 'float',
        'revenue_penetration_for10_percent_seller_funding' => 'float',
        'revenue_penetration_for5_plus_percent_seller_funding' => 'float',
        'share_of_coupon_subscriptions' => 'float',
        'time_interval' => '\SpApi\Model\replenishment\v2022_11_07\TimeInterval',
        'currency_code' => 'string'];

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     *
     * @phpstan-var array<string, string|null>
     *
     * @psalm-var array<string, string|null>
     */
    protected static array $openAPIFormats = [
        'not_delivered_due_to_oos' => 'double',
        'total_subscriptions_revenue' => 'double',
        'shipped_subscription_units' => 'int64',
        'active_subscriptions' => 'int64',
        'subscriber_average_revenue' => 'double',
        'non_subscriber_average_revenue' => 'double',
        'lost_revenue_due_to_oos' => 'double',
        'subscriber_average_reorders' => 'double',
        'non_subscriber_average_reorders' => 'double',
        'coupons_revenue_penetration' => 'double',
        'revenue_from_subscriptions_with_multiple_deliveries' => 'double',
        'revenue_from_active_subscriptions_with_single_delivery' => 'double',
        'revenue_from_cancelled_subscriptions_after_single_delivery' => 'double',
        'subscriber_retention_for30_days' => 'double',
        'subscriber_retention_for90_days' => 'double',
        'revenue_penetration_for0_percent_seller_funding' => 'double',
        'revenue_penetration_for5_percent_seller_funding' => 'double',
        'revenue_penetration_for10_percent_seller_funding' => 'double',
        'revenue_penetration_for5_plus_percent_seller_funding' => 'double',
        'share_of_coupon_subscriptions' => 'double',
        'time_interval' => null,
        'currency_code' => null];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'not_delivered_due_to_oos' => true,
        'total_subscriptions_revenue' => true,
        'shipped_subscription_units' => true,
        'active_subscriptions' => true,
        'subscriber_average_revenue' => true,
        'non_subscriber_average_revenue' => true,
        'lost_revenue_due_to_oos' => true,
        'subscriber_average_reorders' => true,
        'non_subscriber_average_reorders' => true,
        'coupons_revenue_penetration' => true,
        'revenue_from_subscriptions_with_multiple_deliveries' => true,
        'revenue_from_active_subscriptions_with_single_delivery' => true,
        'revenue_from_cancelled_subscriptions_after_single_delivery' => true,
        'subscriber_retention_for30_days' => true,
        'subscriber_retention_for90_days' => true,
        'revenue_penetration_for0_percent_seller_funding' => true,
        'revenue_penetration_for5_percent_seller_funding' => true,
        'revenue_penetration_for10_percent_seller_funding' => true,
        'revenue_penetration_for5_plus_percent_seller_funding' => true,
        'share_of_coupon_subscriptions' => true,
        'time_interval' => true,
        'currency_code' => true,
    ];

    /**
     * If a nullable field gets set to null, insert it here.
     *
     * @var bool[]
     */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @var string[]
     */
    protected static array $attributeMap = [
        'not_delivered_due_to_oos' => 'notDeliveredDueToOOS',
        'total_subscriptions_revenue' => 'totalSubscriptionsRevenue',
        'shipped_subscription_units' => 'shippedSubscriptionUnits',
        'active_subscriptions' => 'activeSubscriptions',
        'subscriber_average_revenue' => 'subscriberAverageRevenue',
        'non_subscriber_average_revenue' => 'nonSubscriberAverageRevenue',
        'lost_revenue_due_to_oos' => 'lostRevenueDueToOOS',
        'subscriber_average_reorders' => 'subscriberAverageReorders',
        'non_subscriber_average_reorders' => 'nonSubscriberAverageReorders',
        'coupons_revenue_penetration' => 'couponsRevenuePenetration',
        'revenue_from_subscriptions_with_multiple_deliveries' => 'revenueFromSubscriptionsWithMultipleDeliveries',
        'revenue_from_active_subscriptions_with_single_delivery' => 'revenueFromActiveSubscriptionsWithSingleDelivery',
        'revenue_from_cancelled_subscriptions_after_single_delivery' => 'revenueFromCancelledSubscriptionsAfterSingleDelivery',
        'subscriber_retention_for30_days' => 'subscriberRetentionFor30Days',
        'subscriber_retention_for90_days' => 'subscriberRetentionFor90Days',
        'revenue_penetration_for0_percent_seller_funding' => 'revenuePenetrationFor0PercentSellerFunding',
        'revenue_penetration_for5_percent_seller_funding' => 'revenuePenetrationFor5PercentSellerFunding',
        'revenue_penetration_for10_percent_seller_funding' => 'revenuePenetrationFor10PercentSellerFunding',
        'revenue_penetration_for5_plus_percent_seller_funding' => 'revenuePenetrationFor5PlusPercentSellerFunding',
        'share_of_coupon_subscriptions' => 'shareOfCouponSubscriptions',
        'time_interval' => 'timeInterval',
        'currency_code' => 'currencyCode',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static array $setters = [
        'not_delivered_due_to_oos' => 'setNotDeliveredDueToOos',
        'total_subscriptions_revenue' => 'setTotalSubscriptionsRevenue',
        'shipped_subscription_units' => 'setShippedSubscriptionUnits',
        'active_subscriptions' => 'setActiveSubscriptions',
        'subscriber_average_revenue' => 'setSubscriberAverageRevenue',
        'non_subscriber_average_revenue' => 'setNonSubscriberAverageRevenue',
        'lost_revenue_due_to_oos' => 'setLostRevenueDueToOos',
        'subscriber_average_reorders' => 'setSubscriberAverageReorders',
        'non_subscriber_average_reorders' => 'setNonSubscriberAverageReorders',
        'coupons_revenue_penetration' => 'setCouponsRevenuePenetration',
        'revenue_from_subscriptions_with_multiple_deliveries' => 'setRevenueFromSubscriptionsWithMultipleDeliveries',
        'revenue_from_active_subscriptions_with_single_delivery' => 'setRevenueFromActiveSubscriptionsWithSingleDelivery',
        'revenue_from_cancelled_subscriptions_after_single_delivery' => 'setRevenueFromCancelledSubscriptionsAfterSingleDelivery',
        'subscriber_retention_for30_days' => 'setSubscriberRetentionFor30Days',
        'subscriber_retention_for90_days' => 'setSubscriberRetentionFor90Days',
        'revenue_penetration_for0_percent_seller_funding' => 'setRevenuePenetrationFor0PercentSellerFunding',
        'revenue_penetration_for5_percent_seller_funding' => 'setRevenuePenetrationFor5PercentSellerFunding',
        'revenue_penetration_for10_percent_seller_funding' => 'setRevenuePenetrationFor10PercentSellerFunding',
        'revenue_penetration_for5_plus_percent_seller_funding' => 'setRevenuePenetrationFor5PlusPercentSellerFunding',
        'share_of_coupon_subscriptions' => 'setShareOfCouponSubscriptions',
        'time_interval' => 'setTimeInterval',
        'currency_code' => 'setCurrencyCode',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static array $getters = [
        'not_delivered_due_to_oos' => 'getNotDeliveredDueToOos',
        'total_subscriptions_revenue' => 'getTotalSubscriptionsRevenue',
        'shipped_subscription_units' => 'getShippedSubscriptionUnits',
        'active_subscriptions' => 'getActiveSubscriptions',
        'subscriber_average_revenue' => 'getSubscriberAverageRevenue',
        'non_subscriber_average_revenue' => 'getNonSubscriberAverageRevenue',
        'lost_revenue_due_to_oos' => 'getLostRevenueDueToOos',
        'subscriber_average_reorders' => 'getSubscriberAverageReorders',
        'non_subscriber_average_reorders' => 'getNonSubscriberAverageReorders',
        'coupons_revenue_penetration' => 'getCouponsRevenuePenetration',
        'revenue_from_subscriptions_with_multiple_deliveries' => 'getRevenueFromSubscriptionsWithMultipleDeliveries',
        'revenue_from_active_subscriptions_with_single_delivery' => 'getRevenueFromActiveSubscriptionsWithSingleDelivery',
        'revenue_from_cancelled_subscriptions_after_single_delivery' => 'getRevenueFromCancelledSubscriptionsAfterSingleDelivery',
        'subscriber_retention_for30_days' => 'getSubscriberRetentionFor30Days',
        'subscriber_retention_for90_days' => 'getSubscriberRetentionFor90Days',
        'revenue_penetration_for0_percent_seller_funding' => 'getRevenuePenetrationFor0PercentSellerFunding',
        'revenue_penetration_for5_percent_seller_funding' => 'getRevenuePenetrationFor5PercentSellerFunding',
        'revenue_penetration_for10_percent_seller_funding' => 'getRevenuePenetrationFor10PercentSellerFunding',
        'revenue_penetration_for5_plus_percent_seller_funding' => 'getRevenuePenetrationFor5PlusPercentSellerFunding',
        'share_of_coupon_subscriptions' => 'getShareOfCouponSubscriptions',
        'time_interval' => 'getTimeInterval',
        'currency_code' => 'getCurrencyCode',
    ];

    /**
     * Associative array for storing property values.
     */
    protected array $container = [];

    /**
     * Constructor.
     *
     * @param null|array $data Associated array of property values
     *                         initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('not_delivered_due_to_oos', $data ?? [], null);
        $this->setIfExists('total_subscriptions_revenue', $data ?? [], null);
        $this->setIfExists('shipped_subscription_units', $data ?? [], null);
        $this->setIfExists('active_subscriptions', $data ?? [], null);
        $this->setIfExists('subscriber_average_revenue', $data ?? [], null);
        $this->setIfExists('non_subscriber_average_revenue', $data ?? [], null);
        $this->setIfExists('lost_revenue_due_to_oos', $data ?? [], null);
        $this->setIfExists('subscriber_average_reorders', $data ?? [], null);
        $this->setIfExists('non_subscriber_average_reorders', $data ?? [], null);
        $this->setIfExists('coupons_revenue_penetration', $data ?? [], null);
        $this->setIfExists('revenue_from_subscriptions_with_multiple_deliveries', $data ?? [], null);
        $this->setIfExists('revenue_from_active_subscriptions_with_single_delivery', $data ?? [], null);
        $this->setIfExists('revenue_from_cancelled_subscriptions_after_single_delivery', $data ?? [], null);
        $this->setIfExists('subscriber_retention_for30_days', $data ?? [], null);
        $this->setIfExists('subscriber_retention_for90_days', $data ?? [], null);
        $this->setIfExists('revenue_penetration_for0_percent_seller_funding', $data ?? [], null);
        $this->setIfExists('revenue_penetration_for5_percent_seller_funding', $data ?? [], null);
        $this->setIfExists('revenue_penetration_for10_percent_seller_funding', $data ?? [], null);
        $this->setIfExists('revenue_penetration_for5_plus_percent_seller_funding', $data ?? [], null);
        $this->setIfExists('share_of_coupon_subscriptions', $data ?? [], null);
        $this->setIfExists('time_interval', $data ?? [], null);
        $this->setIfExists('currency_code', $data ?? [], null);
    }

    /**
     * Gets the string presentation of the object.
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Array of property to type mappings. Used for (de)serialization.
     */
    public static function openAPITypes(): array
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization.
     */
    public static function openAPIFormats(): array
    {
        return self::$openAPIFormats;
    }

    /**
     * Checks if a property is nullable.
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     */
    public static function attributeMap(): array
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     */
    public static function setters(): array
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests).
     */
    public static function getters(): array
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     */
    public function getModelName(): string
    {
        return self::$openAPIModelName;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties(): array
    {
        $invalidProperties = [];

        if (!is_null($this->container['not_delivered_due_to_oos']) && ($this->container['not_delivered_due_to_oos'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'not_delivered_due_to_oos', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['not_delivered_due_to_oos']) && ($this->container['not_delivered_due_to_oos'] < 0)) {
            $invalidProperties[] = "invalid value for 'not_delivered_due_to_oos', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['total_subscriptions_revenue']) && ($this->container['total_subscriptions_revenue'] < 0)) {
            $invalidProperties[] = "invalid value for 'total_subscriptions_revenue', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['shipped_subscription_units']) && ($this->container['shipped_subscription_units'] < 0)) {
            $invalidProperties[] = "invalid value for 'shipped_subscription_units', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['active_subscriptions']) && ($this->container['active_subscriptions'] < 0)) {
            $invalidProperties[] = "invalid value for 'active_subscriptions', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['subscriber_average_revenue']) && ($this->container['subscriber_average_revenue'] < 0)) {
            $invalidProperties[] = "invalid value for 'subscriber_average_revenue', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['non_subscriber_average_revenue']) && ($this->container['non_subscriber_average_revenue'] < 0)) {
            $invalidProperties[] = "invalid value for 'non_subscriber_average_revenue', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['lost_revenue_due_to_oos']) && ($this->container['lost_revenue_due_to_oos'] < 0)) {
            $invalidProperties[] = "invalid value for 'lost_revenue_due_to_oos', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['subscriber_average_reorders']) && ($this->container['subscriber_average_reorders'] < 0)) {
            $invalidProperties[] = "invalid value for 'subscriber_average_reorders', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['non_subscriber_average_reorders']) && ($this->container['non_subscriber_average_reorders'] < 0)) {
            $invalidProperties[] = "invalid value for 'non_subscriber_average_reorders', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['coupons_revenue_penetration']) && ($this->container['coupons_revenue_penetration'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'coupons_revenue_penetration', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['coupons_revenue_penetration']) && ($this->container['coupons_revenue_penetration'] < 0)) {
            $invalidProperties[] = "invalid value for 'coupons_revenue_penetration', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['revenue_from_subscriptions_with_multiple_deliveries']) && ($this->container['revenue_from_subscriptions_with_multiple_deliveries'] < 0)) {
            $invalidProperties[] = "invalid value for 'revenue_from_subscriptions_with_multiple_deliveries', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['revenue_from_active_subscriptions_with_single_delivery']) && ($this->container['revenue_from_active_subscriptions_with_single_delivery'] < 0)) {
            $invalidProperties[] = "invalid value for 'revenue_from_active_subscriptions_with_single_delivery', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['revenue_from_cancelled_subscriptions_after_single_delivery']) && ($this->container['revenue_from_cancelled_subscriptions_after_single_delivery'] < 0)) {
            $invalidProperties[] = "invalid value for 'revenue_from_cancelled_subscriptions_after_single_delivery', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['subscriber_retention_for30_days']) && ($this->container['subscriber_retention_for30_days'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'subscriber_retention_for30_days', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['subscriber_retention_for30_days']) && ($this->container['subscriber_retention_for30_days'] < 0)) {
            $invalidProperties[] = "invalid value for 'subscriber_retention_for30_days', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['subscriber_retention_for90_days']) && ($this->container['subscriber_retention_for90_days'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'subscriber_retention_for90_days', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['subscriber_retention_for90_days']) && ($this->container['subscriber_retention_for90_days'] < 0)) {
            $invalidProperties[] = "invalid value for 'subscriber_retention_for90_days', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['revenue_penetration_for0_percent_seller_funding']) && ($this->container['revenue_penetration_for0_percent_seller_funding'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for0_percent_seller_funding', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['revenue_penetration_for0_percent_seller_funding']) && ($this->container['revenue_penetration_for0_percent_seller_funding'] < 0)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for0_percent_seller_funding', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['revenue_penetration_for5_percent_seller_funding']) && ($this->container['revenue_penetration_for5_percent_seller_funding'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for5_percent_seller_funding', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['revenue_penetration_for5_percent_seller_funding']) && ($this->container['revenue_penetration_for5_percent_seller_funding'] < 0)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for5_percent_seller_funding', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['revenue_penetration_for10_percent_seller_funding']) && ($this->container['revenue_penetration_for10_percent_seller_funding'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for10_percent_seller_funding', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['revenue_penetration_for10_percent_seller_funding']) && ($this->container['revenue_penetration_for10_percent_seller_funding'] < 0)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for10_percent_seller_funding', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['revenue_penetration_for5_plus_percent_seller_funding']) && ($this->container['revenue_penetration_for5_plus_percent_seller_funding'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for5_plus_percent_seller_funding', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['revenue_penetration_for5_plus_percent_seller_funding']) && ($this->container['revenue_penetration_for5_plus_percent_seller_funding'] < 0)) {
            $invalidProperties[] = "invalid value for 'revenue_penetration_for5_plus_percent_seller_funding', must be bigger than or equal to 0.";
        }

        if (!is_null($this->container['share_of_coupon_subscriptions']) && ($this->container['share_of_coupon_subscriptions'] > 1E+2)) {
            $invalidProperties[] = "invalid value for 'share_of_coupon_subscriptions', must be smaller than or equal to 1E+2.";
        }

        if (!is_null($this->container['share_of_coupon_subscriptions']) && ($this->container['share_of_coupon_subscriptions'] < 0)) {
            $invalidProperties[] = "invalid value for 'share_of_coupon_subscriptions', must be bigger than or equal to 0.";
        }

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed.
     *
     * @return bool True if all properties are valid
     */
    public function valid(): bool
    {
        return 0 === count($this->listInvalidProperties());
    }

    /**
     * Gets not_delivered_due_to_oos.
     */
    public function getNotDeliveredDueToOos(): ?float
    {
        return $this->container['not_delivered_due_to_oos'];
    }

    /**
     * Sets not_delivered_due_to_oos.
     *
     * @param null|float $not_delivered_due_to_oos The percentage of items that were not shipped out of the total shipped units over a period of time due to being out of stock. Applicable to PERFORMANCE timePeriodType.
     */
    public function setNotDeliveredDueToOos(?float $not_delivered_due_to_oos): self
    {
        if (is_null($not_delivered_due_to_oos)) {
            array_push($this->openAPINullablesSetToNull, 'not_delivered_due_to_oos');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('not_delivered_due_to_oos', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($not_delivered_due_to_oos) && ($not_delivered_due_to_oos > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $not_delivered_due_to_oos when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($not_delivered_due_to_oos) && ($not_delivered_due_to_oos < 0)) {
            throw new \InvalidArgumentException('invalid value for $not_delivered_due_to_oos when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['not_delivered_due_to_oos'] = $not_delivered_due_to_oos;

        return $this;
    }

    /**
     * Gets total_subscriptions_revenue.
     */
    public function getTotalSubscriptionsRevenue(): ?float
    {
        return $this->container['total_subscriptions_revenue'];
    }

    /**
     * Sets total_subscriptions_revenue.
     *
     * @param null|float $total_subscriptions_revenue The revenue generated from subscriptions over a period of time. Applicable for both the PERFORMANCE and FORECAST timePeriodType.
     */
    public function setTotalSubscriptionsRevenue(?float $total_subscriptions_revenue): self
    {
        if (is_null($total_subscriptions_revenue)) {
            array_push($this->openAPINullablesSetToNull, 'total_subscriptions_revenue');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('total_subscriptions_revenue', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($total_subscriptions_revenue) && ($total_subscriptions_revenue < 0)) {
            throw new \InvalidArgumentException('invalid value for $total_subscriptions_revenue when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['total_subscriptions_revenue'] = $total_subscriptions_revenue;

        return $this;
    }

    /**
     * Gets shipped_subscription_units.
     */
    public function getShippedSubscriptionUnits(): ?float
    {
        return $this->container['shipped_subscription_units'];
    }

    /**
     * Sets shipped_subscription_units.
     *
     * @param null|float $shipped_subscription_units The number of units shipped to the subscribers over a period of time. Applicable for both the PERFORMANCE and FORECAST timePeriodType.
     */
    public function setShippedSubscriptionUnits(?float $shipped_subscription_units): self
    {
        if (is_null($shipped_subscription_units)) {
            array_push($this->openAPINullablesSetToNull, 'shipped_subscription_units');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipped_subscription_units', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($shipped_subscription_units) && ($shipped_subscription_units < 0)) {
            throw new \InvalidArgumentException('invalid value for $shipped_subscription_units when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['shipped_subscription_units'] = $shipped_subscription_units;

        return $this;
    }

    /**
     * Gets active_subscriptions.
     */
    public function getActiveSubscriptions(): ?float
    {
        return $this->container['active_subscriptions'];
    }

    /**
     * Sets active_subscriptions.
     *
     * @param null|float $active_subscriptions The number of active subscriptions present at the end of the period. Applicable to PERFORMANCE timePeriodType.
     */
    public function setActiveSubscriptions(?float $active_subscriptions): self
    {
        if (is_null($active_subscriptions)) {
            array_push($this->openAPINullablesSetToNull, 'active_subscriptions');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('active_subscriptions', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($active_subscriptions) && ($active_subscriptions < 0)) {
            throw new \InvalidArgumentException('invalid value for $active_subscriptions when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['active_subscriptions'] = $active_subscriptions;

        return $this;
    }

    /**
     * Gets subscriber_average_revenue.
     */
    public function getSubscriberAverageRevenue(): ?float
    {
        return $this->container['subscriber_average_revenue'];
    }

    /**
     * Sets subscriber_average_revenue.
     *
     * @param null|float $subscriber_average_revenue The average revenue per subscriber of the program over a period of past 12 months for sellers and 6 months for vendors. Applicable to PERFORMANCE timePeriodType.
     */
    public function setSubscriberAverageRevenue(?float $subscriber_average_revenue): self
    {
        if (is_null($subscriber_average_revenue)) {
            array_push($this->openAPINullablesSetToNull, 'subscriber_average_revenue');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('subscriber_average_revenue', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($subscriber_average_revenue) && ($subscriber_average_revenue < 0)) {
            throw new \InvalidArgumentException('invalid value for $subscriber_average_revenue when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['subscriber_average_revenue'] = $subscriber_average_revenue;

        return $this;
    }

    /**
     * Gets non_subscriber_average_revenue.
     */
    public function getNonSubscriberAverageRevenue(): ?float
    {
        return $this->container['non_subscriber_average_revenue'];
    }

    /**
     * Sets non_subscriber_average_revenue.
     *
     * @param null|float $non_subscriber_average_revenue The average revenue per non-subscriber of the program over a period of past 12 months for sellers and 6 months for vendors. Applicable to PERFORMANCE timePeriodType.
     */
    public function setNonSubscriberAverageRevenue(?float $non_subscriber_average_revenue): self
    {
        if (is_null($non_subscriber_average_revenue)) {
            array_push($this->openAPINullablesSetToNull, 'non_subscriber_average_revenue');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('non_subscriber_average_revenue', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($non_subscriber_average_revenue) && ($non_subscriber_average_revenue < 0)) {
            throw new \InvalidArgumentException('invalid value for $non_subscriber_average_revenue when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['non_subscriber_average_revenue'] = $non_subscriber_average_revenue;

        return $this;
    }

    /**
     * Gets lost_revenue_due_to_oos.
     */
    public function getLostRevenueDueToOos(): ?float
    {
        return $this->container['lost_revenue_due_to_oos'];
    }

    /**
     * Sets lost_revenue_due_to_oos.
     *
     * @param null|float $lost_revenue_due_to_oos The revenue that would have been generated had there not been out of stock. Applicable to PERFORMANCE timePeriodType.
     */
    public function setLostRevenueDueToOos(?float $lost_revenue_due_to_oos): self
    {
        if (is_null($lost_revenue_due_to_oos)) {
            array_push($this->openAPINullablesSetToNull, 'lost_revenue_due_to_oos');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('lost_revenue_due_to_oos', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($lost_revenue_due_to_oos) && ($lost_revenue_due_to_oos < 0)) {
            throw new \InvalidArgumentException('invalid value for $lost_revenue_due_to_oos when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['lost_revenue_due_to_oos'] = $lost_revenue_due_to_oos;

        return $this;
    }

    /**
     * Gets subscriber_average_reorders.
     */
    public function getSubscriberAverageReorders(): ?float
    {
        return $this->container['subscriber_average_reorders'];
    }

    /**
     * Sets subscriber_average_reorders.
     *
     * @param null|float $subscriber_average_reorders The average reorders per subscriber of the program over a period of 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setSubscriberAverageReorders(?float $subscriber_average_reorders): self
    {
        if (is_null($subscriber_average_reorders)) {
            array_push($this->openAPINullablesSetToNull, 'subscriber_average_reorders');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('subscriber_average_reorders', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($subscriber_average_reorders) && ($subscriber_average_reorders < 0)) {
            throw new \InvalidArgumentException('invalid value for $subscriber_average_reorders when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['subscriber_average_reorders'] = $subscriber_average_reorders;

        return $this;
    }

    /**
     * Gets non_subscriber_average_reorders.
     */
    public function getNonSubscriberAverageReorders(): ?float
    {
        return $this->container['non_subscriber_average_reorders'];
    }

    /**
     * Sets non_subscriber_average_reorders.
     *
     * @param null|float $non_subscriber_average_reorders The average reorders per non-subscriber of the program over a period of past 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setNonSubscriberAverageReorders(?float $non_subscriber_average_reorders): self
    {
        if (is_null($non_subscriber_average_reorders)) {
            array_push($this->openAPINullablesSetToNull, 'non_subscriber_average_reorders');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('non_subscriber_average_reorders', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($non_subscriber_average_reorders) && ($non_subscriber_average_reorders < 0)) {
            throw new \InvalidArgumentException('invalid value for $non_subscriber_average_reorders when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['non_subscriber_average_reorders'] = $non_subscriber_average_reorders;

        return $this;
    }

    /**
     * Gets coupons_revenue_penetration.
     */
    public function getCouponsRevenuePenetration(): ?float
    {
        return $this->container['coupons_revenue_penetration'];
    }

    /**
     * Sets coupons_revenue_penetration.
     *
     * @param null|float $coupons_revenue_penetration The percentage of revenue from ASINs with coupons out of total revenue from all ASINs. Applicable to PERFORMANCE timePeriodType.
     */
    public function setCouponsRevenuePenetration(?float $coupons_revenue_penetration): self
    {
        if (is_null($coupons_revenue_penetration)) {
            array_push($this->openAPINullablesSetToNull, 'coupons_revenue_penetration');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('coupons_revenue_penetration', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($coupons_revenue_penetration) && ($coupons_revenue_penetration > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $coupons_revenue_penetration when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($coupons_revenue_penetration) && ($coupons_revenue_penetration < 0)) {
            throw new \InvalidArgumentException('invalid value for $coupons_revenue_penetration when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['coupons_revenue_penetration'] = $coupons_revenue_penetration;

        return $this;
    }

    /**
     * Gets revenue_from_subscriptions_with_multiple_deliveries.
     */
    public function getRevenueFromSubscriptionsWithMultipleDeliveries(): ?float
    {
        return $this->container['revenue_from_subscriptions_with_multiple_deliveries'];
    }

    /**
     * Sets revenue_from_subscriptions_with_multiple_deliveries.
     *
     * @param null|float $revenue_from_subscriptions_with_multiple_deliveries The subscription revenue generated from subscriptions with over two deliveries over the past 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setRevenueFromSubscriptionsWithMultipleDeliveries(?float $revenue_from_subscriptions_with_multiple_deliveries): self
    {
        if (is_null($revenue_from_subscriptions_with_multiple_deliveries)) {
            array_push($this->openAPINullablesSetToNull, 'revenue_from_subscriptions_with_multiple_deliveries');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revenue_from_subscriptions_with_multiple_deliveries', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($revenue_from_subscriptions_with_multiple_deliveries) && ($revenue_from_subscriptions_with_multiple_deliveries < 0)) {
            throw new \InvalidArgumentException('invalid value for $revenue_from_subscriptions_with_multiple_deliveries when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['revenue_from_subscriptions_with_multiple_deliveries'] = $revenue_from_subscriptions_with_multiple_deliveries;

        return $this;
    }

    /**
     * Gets revenue_from_active_subscriptions_with_single_delivery.
     */
    public function getRevenueFromActiveSubscriptionsWithSingleDelivery(): ?float
    {
        return $this->container['revenue_from_active_subscriptions_with_single_delivery'];
    }

    /**
     * Sets revenue_from_active_subscriptions_with_single_delivery.
     *
     * @param null|float $revenue_from_active_subscriptions_with_single_delivery The subscription revenue generated from active subscriptions with one delivery over the past 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setRevenueFromActiveSubscriptionsWithSingleDelivery(?float $revenue_from_active_subscriptions_with_single_delivery): self
    {
        if (is_null($revenue_from_active_subscriptions_with_single_delivery)) {
            array_push($this->openAPINullablesSetToNull, 'revenue_from_active_subscriptions_with_single_delivery');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revenue_from_active_subscriptions_with_single_delivery', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($revenue_from_active_subscriptions_with_single_delivery) && ($revenue_from_active_subscriptions_with_single_delivery < 0)) {
            throw new \InvalidArgumentException('invalid value for $revenue_from_active_subscriptions_with_single_delivery when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['revenue_from_active_subscriptions_with_single_delivery'] = $revenue_from_active_subscriptions_with_single_delivery;

        return $this;
    }

    /**
     * Gets revenue_from_cancelled_subscriptions_after_single_delivery.
     */
    public function getRevenueFromCancelledSubscriptionsAfterSingleDelivery(): ?float
    {
        return $this->container['revenue_from_cancelled_subscriptions_after_single_delivery'];
    }

    /**
     * Sets revenue_from_cancelled_subscriptions_after_single_delivery.
     *
     * @param null|float $revenue_from_cancelled_subscriptions_after_single_delivery The subscription revenue generated from subscriptions which are cancelled after one delivery over the past 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setRevenueFromCancelledSubscriptionsAfterSingleDelivery(?float $revenue_from_cancelled_subscriptions_after_single_delivery): self
    {
        if (is_null($revenue_from_cancelled_subscriptions_after_single_delivery)) {
            array_push($this->openAPINullablesSetToNull, 'revenue_from_cancelled_subscriptions_after_single_delivery');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revenue_from_cancelled_subscriptions_after_single_delivery', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($revenue_from_cancelled_subscriptions_after_single_delivery) && ($revenue_from_cancelled_subscriptions_after_single_delivery < 0)) {
            throw new \InvalidArgumentException('invalid value for $revenue_from_cancelled_subscriptions_after_single_delivery when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['revenue_from_cancelled_subscriptions_after_single_delivery'] = $revenue_from_cancelled_subscriptions_after_single_delivery;

        return $this;
    }

    /**
     * Gets subscriber_retention_for30_days.
     */
    public function getSubscriberRetentionFor30Days(): ?float
    {
        return $this->container['subscriber_retention_for30_days'];
    }

    /**
     * Sets subscriber_retention_for30_days.
     *
     * @param null|float $subscriber_retention_for30_days The percentage of subscriptions retained after 30 days of subscription creation. Applicable to PERFORMANCE timePeriodType.
     */
    public function setSubscriberRetentionFor30Days(?float $subscriber_retention_for30_days): self
    {
        if (is_null($subscriber_retention_for30_days)) {
            array_push($this->openAPINullablesSetToNull, 'subscriber_retention_for30_days');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('subscriber_retention_for30_days', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($subscriber_retention_for30_days) && ($subscriber_retention_for30_days > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $subscriber_retention_for30_days when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($subscriber_retention_for30_days) && ($subscriber_retention_for30_days < 0)) {
            throw new \InvalidArgumentException('invalid value for $subscriber_retention_for30_days when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['subscriber_retention_for30_days'] = $subscriber_retention_for30_days;

        return $this;
    }

    /**
     * Gets subscriber_retention_for90_days.
     */
    public function getSubscriberRetentionFor90Days(): ?float
    {
        return $this->container['subscriber_retention_for90_days'];
    }

    /**
     * Sets subscriber_retention_for90_days.
     *
     * @param null|float $subscriber_retention_for90_days The percentage of subscriptions retained after 90 days of subscription creation. Applicable to PERFORMANCE timePeriodType.
     */
    public function setSubscriberRetentionFor90Days(?float $subscriber_retention_for90_days): self
    {
        if (is_null($subscriber_retention_for90_days)) {
            array_push($this->openAPINullablesSetToNull, 'subscriber_retention_for90_days');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('subscriber_retention_for90_days', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($subscriber_retention_for90_days) && ($subscriber_retention_for90_days > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $subscriber_retention_for90_days when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($subscriber_retention_for90_days) && ($subscriber_retention_for90_days < 0)) {
            throw new \InvalidArgumentException('invalid value for $subscriber_retention_for90_days when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['subscriber_retention_for90_days'] = $subscriber_retention_for90_days;

        return $this;
    }

    /**
     * Gets revenue_penetration_for0_percent_seller_funding.
     */
    public function getRevenuePenetrationFor0PercentSellerFunding(): ?float
    {
        return $this->container['revenue_penetration_for0_percent_seller_funding'];
    }

    /**
     * Sets revenue_penetration_for0_percent_seller_funding.
     *
     * @param null|float $revenue_penetration_for0_percent_seller_funding The percentage of subscription revenue generated by offers with 0% seller-funded discount over the last 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setRevenuePenetrationFor0PercentSellerFunding(?float $revenue_penetration_for0_percent_seller_funding): self
    {
        if (is_null($revenue_penetration_for0_percent_seller_funding)) {
            array_push($this->openAPINullablesSetToNull, 'revenue_penetration_for0_percent_seller_funding');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revenue_penetration_for0_percent_seller_funding', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($revenue_penetration_for0_percent_seller_funding) && ($revenue_penetration_for0_percent_seller_funding > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for0_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($revenue_penetration_for0_percent_seller_funding) && ($revenue_penetration_for0_percent_seller_funding < 0)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for0_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['revenue_penetration_for0_percent_seller_funding'] = $revenue_penetration_for0_percent_seller_funding;

        return $this;
    }

    /**
     * Gets revenue_penetration_for5_percent_seller_funding.
     */
    public function getRevenuePenetrationFor5PercentSellerFunding(): ?float
    {
        return $this->container['revenue_penetration_for5_percent_seller_funding'];
    }

    /**
     * Sets revenue_penetration_for5_percent_seller_funding.
     *
     * @param null|float $revenue_penetration_for5_percent_seller_funding [Applicable only for Sellers] The percentage of subscription revenue generated by offers with 5% seller-funded discount over the last 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setRevenuePenetrationFor5PercentSellerFunding(?float $revenue_penetration_for5_percent_seller_funding): self
    {
        if (is_null($revenue_penetration_for5_percent_seller_funding)) {
            array_push($this->openAPINullablesSetToNull, 'revenue_penetration_for5_percent_seller_funding');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revenue_penetration_for5_percent_seller_funding', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($revenue_penetration_for5_percent_seller_funding) && ($revenue_penetration_for5_percent_seller_funding > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for5_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($revenue_penetration_for5_percent_seller_funding) && ($revenue_penetration_for5_percent_seller_funding < 0)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for5_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['revenue_penetration_for5_percent_seller_funding'] = $revenue_penetration_for5_percent_seller_funding;

        return $this;
    }

    /**
     * Gets revenue_penetration_for10_percent_seller_funding.
     */
    public function getRevenuePenetrationFor10PercentSellerFunding(): ?float
    {
        return $this->container['revenue_penetration_for10_percent_seller_funding'];
    }

    /**
     * Sets revenue_penetration_for10_percent_seller_funding.
     *
     * @param null|float $revenue_penetration_for10_percent_seller_funding [Applicable only for Sellers] The percentage of subscription revenue generated by offers with 10% seller-funded discount over the last 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setRevenuePenetrationFor10PercentSellerFunding(?float $revenue_penetration_for10_percent_seller_funding): self
    {
        if (is_null($revenue_penetration_for10_percent_seller_funding)) {
            array_push($this->openAPINullablesSetToNull, 'revenue_penetration_for10_percent_seller_funding');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revenue_penetration_for10_percent_seller_funding', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($revenue_penetration_for10_percent_seller_funding) && ($revenue_penetration_for10_percent_seller_funding > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for10_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($revenue_penetration_for10_percent_seller_funding) && ($revenue_penetration_for10_percent_seller_funding < 0)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for10_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['revenue_penetration_for10_percent_seller_funding'] = $revenue_penetration_for10_percent_seller_funding;

        return $this;
    }

    /**
     * Gets revenue_penetration_for5_plus_percent_seller_funding.
     */
    public function getRevenuePenetrationFor5PlusPercentSellerFunding(): ?float
    {
        return $this->container['revenue_penetration_for5_plus_percent_seller_funding'];
    }

    /**
     * Sets revenue_penetration_for5_plus_percent_seller_funding.
     *
     * @param null|float $revenue_penetration_for5_plus_percent_seller_funding [Applicable only for vendors] The percentage of subscription revenue generated by offers with 5% or above seller-funded discount over the last 12 months. Applicable to PERFORMANCE timePeriodType.
     */
    public function setRevenuePenetrationFor5PlusPercentSellerFunding(?float $revenue_penetration_for5_plus_percent_seller_funding): self
    {
        if (is_null($revenue_penetration_for5_plus_percent_seller_funding)) {
            array_push($this->openAPINullablesSetToNull, 'revenue_penetration_for5_plus_percent_seller_funding');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('revenue_penetration_for5_plus_percent_seller_funding', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($revenue_penetration_for5_plus_percent_seller_funding) && ($revenue_penetration_for5_plus_percent_seller_funding > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for5_plus_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($revenue_penetration_for5_plus_percent_seller_funding) && ($revenue_penetration_for5_plus_percent_seller_funding < 0)) {
            throw new \InvalidArgumentException('invalid value for $revenue_penetration_for5_plus_percent_seller_funding when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['revenue_penetration_for5_plus_percent_seller_funding'] = $revenue_penetration_for5_plus_percent_seller_funding;

        return $this;
    }

    /**
     * Gets share_of_coupon_subscriptions.
     */
    public function getShareOfCouponSubscriptions(): ?float
    {
        return $this->container['share_of_coupon_subscriptions'];
    }

    /**
     * Sets share_of_coupon_subscriptions.
     *
     * @param null|float $share_of_coupon_subscriptions The percentage of new subscriptions acquired through coupons. Applicable to PERFORMANCE timePeriodType.
     */
    public function setShareOfCouponSubscriptions(?float $share_of_coupon_subscriptions): self
    {
        if (is_null($share_of_coupon_subscriptions)) {
            array_push($this->openAPINullablesSetToNull, 'share_of_coupon_subscriptions');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('share_of_coupon_subscriptions', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }

        if (!is_null($share_of_coupon_subscriptions) && ($share_of_coupon_subscriptions > 1E+2)) {
            throw new \InvalidArgumentException('invalid value for $share_of_coupon_subscriptions when calling GetSellingPartnerMetricsResponseMetric., must be smaller than or equal to 1E+2.');
        }
        if (!is_null($share_of_coupon_subscriptions) && ($share_of_coupon_subscriptions < 0)) {
            throw new \InvalidArgumentException('invalid value for $share_of_coupon_subscriptions when calling GetSellingPartnerMetricsResponseMetric., must be bigger than or equal to 0.');
        }

        $this->container['share_of_coupon_subscriptions'] = $share_of_coupon_subscriptions;

        return $this;
    }

    /**
     * Gets time_interval.
     */
    public function getTimeInterval(): ?TimeInterval
    {
        return $this->container['time_interval'];
    }

    /**
     * Sets time_interval.
     *
     * @param null|TimeInterval $time_interval time_interval
     */
    public function setTimeInterval(?TimeInterval $time_interval): self
    {
        if (is_null($time_interval)) {
            array_push($this->openAPINullablesSetToNull, 'time_interval');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('time_interval', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['time_interval'] = $time_interval;

        return $this;
    }

    /**
     * Gets currency_code.
     */
    public function getCurrencyCode(): ?string
    {
        return $this->container['currency_code'];
    }

    /**
     * Sets currency_code.
     *
     * @param null|string $currency_code the currency code in ISO 4217 format
     */
    public function setCurrencyCode(?string $currency_code): self
    {
        if (is_null($currency_code)) {
            array_push($this->openAPINullablesSetToNull, 'currency_code');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('currency_code', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['currency_code'] = $currency_code;

        return $this;
    }

    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param int $offset Offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param int $offset Offset
     *
     * @return null|mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset): mixed
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param null|int $offset Offset
     * @param mixed    $value  Value to be set
     */
    public function offsetSet($offset, mixed $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param int $offset Offset
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     *
     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed returns data which can be serialized by json_encode(), which is a value
     *               of any type other than a resource
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize(): mixed
    {
        return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets a header-safe presentation of the object.
     */
    public function toHeaderValue(): string
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }

    /**
     * Array of nullable properties.
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null.
     *
     * @return bool[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null.
     *
     * @param bool[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
     * $this->openAPINullablesSetToNull array.
     *
     * @param mixed $defaultValue
     */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }
}
